﻿@{
    ViewBag.Title = "Index";
    Layout = "~/Views/Shared/_Layout.cshtml";
    
}
@using Webdiyer.WebControls.Mvc
@model PagedList<ElingOA6_DSJCJ.Models.HREmplGrid>
<script>
    function query() {
        var url = "/AddrBook/Index";
        var deptNo = $('#DeptNo').val();
        var EmplName = $.trim($('#EmplName').val());

        window.location.href = url + "?DeptNo=" + deptNo + "&EmplName="+EmplName;
    }


</script>

 <div class="list_page">
    	<div class="where"><b>当前位置：</b><a href="#">首页</a>&gt;<a href="#">通讯录</a></div>
        <div class="txl">
            	
                <span class="sp-left">
            <table width="100%">
                <tbody>
                    <tr>
                      <td width="4%" style=" text-align:left; font-size:14px;">姓名:</td>
                                      <td width="10%"><input name="EmplName" type="text" id="EmplName" style=" width:150px;"></td>
                        <td style="width:4%; text-align:right; font-size:14px;">部门:</td>
                         <td width="14%">
                            <select name="dept_id" id="DeptNo"style=" width:150px;" onchange="query()">
                                @{List<SelectListItem> itemList = ViewData["deptItemList"] as List<SelectListItem>;
                                  string deptNo = ViewData["deptNo"] == null ? "" : ViewData["deptNo"].ToString();
                                  foreach (SelectListItem item in itemList)
                                  {
                                      if (deptNo == item.Value)
                                      {
                                    <option selected value="@item.Value">@item.Text</option>
                                      }
                                      else
                                      {
                                    <option value="@item.Value">@item.Text</option>
                                      }
                                  }
                                }
                            </select>
                        </td>                     <td style="width:45%; text-align:left;">
                            <input type="button"  class="txl_btn" name="btnQuery" id="btnQuery" value="查 询" onclick="query()" />
                        </td>
                    </tr>
                </tbody>
            </table>
		</span>
                
       <span class="sp-left">
            <table cellspacing="0" cellpadding="4" id="Content_gvDetail" style="color:#333333;width:100%;border-collapse:collapse;">
		<tbody><tr style="color:White;background-color:#03A5FA;font-weight:bold; font-size:14px;">
			            <th scope="col" style="text-align: left"><strong>姓名</strong></th>
                        <th scope="col" style="text-align: left"><strong>职务</strong></th>
                        <th scope="col" style="text-align: left"><strong>部门</strong></th>
                        <th scope="col" style="text-align: left"><strong>联系电话</strong></th>
                        <th scope="col" style="text-align: left"><strong>职责</strong></th>
                        <th scope="col" style="text-align: left"><strong>手机</strong></th>
                        <th scope="col" style="text-align: left"><strong>宅电</strong></th>
		            </tr>
                    @{int rowCount = 0;}

                    @foreach (ElingOA6_DSJCJ.Models.HREmplGrid empModel in Model)
                    {
                        if (rowCount % 2 == 0)
                        {
                            <tr style="background-color:#EFF3FB;">
                                <td>@empModel.FEmpName</td>
                                <td>@empModel.FDutyName</td>
                                <td>@empModel.FDeptName</td>
                                <td>@empModel.FOfficeTel</td>
                                <td>@empModel.FJob</td>
                                <td>@empModel.FMobile</td>
                                <td>@empModel.FHomeTel</td>
                            </tr>
                        }
                        else
                        {
                            <tr style="background-color:White;">
                                <td>@empModel.FEmpName</td>
                                <td>@empModel.FDutyName</td>
                                <td>@empModel.FDeptName</td>
                                <td>@empModel.FOfficeTel</td>
                                <td>@empModel.FJob</td>
                                <td>@empModel.FMobile</td>
                                <td>@empModel.FHomeTel</td>
                            </tr>
                        }
                        rowCount++;
                    }
	            </tbody>
            </table>
            <table width="100%" cellspacing="0" cellpadding="0" height="35" style="margin-left:2%;">
                <tr>
                    <td>
                        <span style="float: left; width: 50%;">共 @Model.TotalItemCount 条记录，页 @Model.CurrentPageIndex/@Model.TotalPageCount</span>
                        @Html.Pager(Model, new PagerOptions { ContainerTagName = "span", PageIndexParameterName = "id", AlwaysShowFirstLastPageNumber = true, HorizontalAlign = "right", FirstPageText = "首页", LastPageText = "末页" }, new { style = "" })
                    </td>
                </tr>
            </table>
</span>
                
      
                
        <div class="clear"></div>
    </div>
</div>





